package cn.com.open.itembank.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 试卷大题.
 */
public class PaperSectionDto {
    /**
     * Instantiates a new Paper section.
     */
    public PaperSectionDto() {
        this.mandatoryQuestions = new ArrayList<>();
        this.exampleQuestions = new ArrayList<>();
        this.paperItemGroups = new ArrayList<>();
    }

    /**
     * 必考题.
     */
    private List<String> mandatoryQuestions;

    /**
     * 例题.
     */
    private List<String> exampleQuestions;

    /**
     * 题组.
     */
    private List<PaperItemGroup> paperItemGroups;

    /**
     * Gets mandatory questions.
     *
     * @return the mandatory questions
     */
    public List<String> getMandatoryQuestions() {
        if (mandatoryQuestions == null) {
            mandatoryQuestions = new ArrayList<>();
        }
        return mandatoryQuestions;
    }

    /**
     * Gets example questions.
     *
     * @return the example questions
     */
    public List<String> getExampleQuestions() {
        if (exampleQuestions == null) {
            exampleQuestions = new ArrayList<>();
        }
        return exampleQuestions;
    }

    /**
     * Gets paper item groups.
     *
     * @return the paper item groups
     */
    public List<PaperItemGroup> getPaperItemGroups() {
        if (paperItemGroups == null) {
            paperItemGroups = new ArrayList<>();
        }
        return paperItemGroups;
    }

    /**
     * copy paper section.
     *
     * @return the paper section
     */
    public PaperSectionDto copy() {
        PaperSectionDto copy = new PaperSectionDto();

        for (String q : mandatoryQuestions) {
            copy.mandatoryQuestions.add(q);
        }
        for (String q : exampleQuestions) {
            copy.exampleQuestions.add(q);
        }
        for (PaperItemGroup r : paperItemGroups) {
            copy.paperItemGroups.add(r.copy());
        }
        return copy;
    }
}
